#include "TInput.h"
LRESULT TInput::MsgProc(	HWND hWnd, 
				UINT msg, 
				WPARAM wParam, 
				LPARAM lParam) 
{
	return 0;
}
bool TInput::Init()
{
	memset(&m_dwKeyState, 0, sizeof(DWORD)*256);
	return true;
}
DWORD TInput::KeyCheck( DWORD dwCheckKey )
{
	//0x0000 0x8000 0x8001 0x0001
	if( GetAsyncKeyState(dwCheckKey) & 0x8000 )
	{
		if( m_dwKeyState[dwCheckKey] == KEY_FREE || 
			m_dwKeyState[dwCheckKey] == KEY_UP )
		{
			m_dwKeyState[dwCheckKey] = KEY_PUSH;
		}
		else
		{
			m_dwKeyState[dwCheckKey] = KEY_HOLD;
		}
	}else
	{
		if( m_dwKeyState[dwCheckKey] == KEY_PUSH || 
			m_dwKeyState[dwCheckKey] == KEY_HOLD )
		{
			m_dwKeyState[dwCheckKey] = KEY_UP;
		}
		else
		{
			m_dwKeyState[dwCheckKey] = KEY_FREE;
		}
	}
	return m_dwKeyState[dwCheckKey];
}
bool TInput::Frame()
{
	m_InputState.dwKeyA = KeyCheck( 'A' );
	m_InputState.dwKeyD = KeyCheck( 'D' );
	m_InputState.dwKeyW = KeyCheck( 'W' );
	m_InputState.dwKeyS = KeyCheck( 'S' );
	m_InputState.dwSpace = KeyCheck( VK_SPACE );
	return true;
}
bool TInput::Render()
{
	return true;
}
bool TInput::Release()
{
	return true;
}
TInput::TInput(void)
{
}

TInput::~TInput(void)
{
}
